import 'package:json_annotation/json_annotation.dart';


List<NovelBookSource> getNovelBookSourceList(List<dynamic> list){
  List<NovelBookSource> result = [];
  list.forEach((item){
    result.add(NovelBookSource.fromJson(item));
  });
  return result;
}
@JsonSerializable()
class NovelBookSource extends Object {

  @JsonKey(name: '_id')
  String id;

  @JsonKey(name: 'isCharge')
  bool isCharge;

  @JsonKey(name: 'name')
  String name;

  @JsonKey(name: 'lastChapter')
  String lastChapter;

  @JsonKey(name: 'updated')
  String updated;

  @JsonKey(name: 'source')
  String source;

  @JsonKey(name: 'link')
  String link;

  @JsonKey(name: 'starting')
  bool starting;

  @JsonKey(name: 'chaptersCount')
  int chaptersCount;

  @JsonKey(name: 'host')
  String host;

  NovelBookSource(this.id,this.isCharge,this.name,this.lastChapter,this.updated,this.source,this.link,this.starting,this.chaptersCount,this.host,);

  factory NovelBookSource.fromJson(Map<String, dynamic> srcJson) => _$NovelBookSourceFromJson(srcJson);

  Map<String, dynamic> toJson() => _$NovelBookSourceToJson(this);

}

NovelBookSource _$NovelBookSourceFromJson(Map<String, dynamic> json) {
  return NovelBookSource(
    json['_id'] as String,
    json['isCharge'] as bool,
    json['name'] as String,
    json['lastChapter'] as String,
    json['updated'] as String,
    json['source'] as String,
    json['link'] as String,
    json['starting'] as bool,
    json['chaptersCount'] as int,
    json['host'] as String,
  );
}

Map<String, dynamic> _$NovelBookSourceToJson(NovelBookSource instance) =>
    <String, dynamic>{
      '_id': instance.id,
      'isCharge': instance.isCharge,
      'name': instance.name,
      'lastChapter': instance.lastChapter,
      'updated': instance.updated,
      'source': instance.source,
      'link': instance.link,
      'starting': instance.starting,
      'chaptersCount': instance.chaptersCount,
      'host': instance.host,
    };


